<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.business.Testpjmanage,com.ejoysoft.common.Constants,com.ejoysoft.wlanyz.system.SysUserUnit,com.ejoysoft.common.exception.NoRightException" %>
<%@ include file="../include/jsp/head.jsp"%>
<%
if(!globa.userSession.hasRight("10015"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");
%>

<% 
    //初始化
    Testpjmanage  user0=null;
    Testpjmanage obj=new Testpjmanage(globa);
    //查询条件
    String  strProjectName=ParamUtil.getString(request,"strProjectName","");
    String checked1 =  ParamUtil.getString(request,"checkedFlag","all");
	String tWhere=" WHERE 1=1";
	if (!strProjectName.equals("")) {
		tWhere += " and strProjectName LIKE '%" + strProjectName + "%'";
	}
	//记录总数
	int intAllCount=obj.getCount(tWhere);
	//当前页
	int intCurPage=globa.getIntCurPage();
	//每页记录数
	String strPageSize = ParamUtil.getString(request,"strPageSize","10");
    int intPageSize;
    if(strPageSize.equals("所有"))intPageSize = intAllCount;
      else  intPageSize = Integer.parseInt(strPageSize);
	//共有页数
 	int intPageCount=(intAllCount-1)/intPageSize+1;
	// 循环显示一页内的记录 开始序号
	int intStartNum=(intCurPage-1)*intPageSize+1;
	//结束序号
	int intEndNum=intCurPage*intPageSize;   
	//获取到当前页面的记录集
	Vector<Testpjmanage> vctObj=obj.list(tWhere,intStartNum,intPageSize);
	//获取当前页的记录条数
	int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=application.getAttribute("APP_TITLE")%></title> 
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../include/date/popc.js"></script>
<script src="../include/js/list.js"></script>
<script language="javascript">
//增加信息
function add() {
   frm.action="testpjmanage_add.jsp";
   frm.submit();
}

 function showAc(){
   document.getElementById('<%=Constants.PAGE_SIZE_INDEX%>').value= "1";
  frm.submit();
 }
 function export_sbm(page){ 
  frm.action="testpjmanage_export.jsp";
  document.getElementById("strCurPage").value = "<%=intCurPage%>";
  document.getElementById("exportContent").value = page;
  frm.submit();
 }
 function del(){
	if (iCheckedNumber(document.all.strProjectId) == 0) {
		alert("请先选择要删除的记录！");
		return;
	}
    if(!confirm('您是否确认要删除所选中的所有记录？'))
        return;
     frm.action="testpjmanage_act.jsp?<%=Constants.ACTION_TYPE%>=<%=Constants.DELETE_STR%>";
     frm.submit();
}
</script>
<style>
A {text-decoration: NONE} 
</style>
</head>


<body>
<form name=frm method=post action="testpjmanage_list.jsp"> 
<input id="exportFlag" name="exportFlag" type="hidden" value="exportResult"/>
<input id="strCurPage" name="strCurPage" type="hidden" value="<%=intCurPage%>"/>
<input id="exportContent" name="exportContent" type="hidden" value=""/>
<input id="checkedFlag" name="checkedFlag" type="hidden" value="<%=checked1%>"/>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><img src="../images/ri_list.jpg" width="14" height="14" align="bottom" />&nbsp;您现在所在的位置：<font color="#0e7cc9">任务管理</font> &gt; 测试项目管理</td>
  </tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  
  <tr>
    <td height="45" valign="middle" bgcolor="e1eef7">
      <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="89%">测试项名称：
          <input type="text" name="strProjectName" value="<%=strProjectName %>"/>
          <img src="../images/search.jpg" width="58" height="28" align="middle" onclick="showAc()" style="cursor:hand"/></td>
          <td width="11%" align="right"><img src="../images/add.jpg" width="64" height="27" onClick="add()" style="cursor:hand"/></td>
        </tr>
      </table></td>
  </tr>
</table>

<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
    <td width="6%" class="listtit"  style="border-left:1px solid #32a4ea;"><input type="checkbox" name="checkbox62" value="checkbox" onclick="selAll(document.all.strProjectId)" style="height:12px;" />
    全选</td>
    <td width="13%" class="listtit">测试项目</td>
    <td width="8%" class="listtit">备注</td>
    <td width="16%" class="listtit">操作人</td>
    <td width="16%" class="listtit">操作时间</td>
    <td width="17%" class="listtit">基本操作</td>
  </tr>
    <%
            
              for (int i = 0;i < vctObj.size(); i++) {
              String id="";
              String name = "";
              String note = "";
              String creator = "";
              String time = "";
            	Testpjmanage obj1 = vctObj.get(i);
            	if(obj1.getStrProjectId()!=null)id=obj1.getStrProjectId();
            	if(obj1.getStrProjectName()!=null)name=obj1.getStrProjectName();
            	if(obj1.getStrProjectNote()!=null)note=obj1.getStrProjectNote();
            	if(obj1.getStrCreator()!=null)creator=obj1.getStrCreator();
            	if(obj1.getDtCreatDate()!=null)time = obj1.getDtCreatDate();
            %>

  <tr>
    <td class="listd1" style="border-left:1px solid #dddddd;"><input type="checkbox"  name=strProjectId value="<%=id %>" style="height:12px;" /></td>
    <td class="listd1" style="border-left:1px solid #dddddd;"><%=name %></a>&nbsp;</td>
    <td class="listd1"><%=note %>&nbsp;</td>
    <td class="listd1"><%=creator%>&nbsp;</td>
    <td class="listd1"><%=time%>&nbsp;</td>

    <td class="listdrd" style="border-right:1px solid #dddddd;"> <img src="../images/mid.jpg" width="12" height="12" align="middle" /> <a href="testpjmanage_update.jsp?strProjectId=<%=obj1.getStrProjectId()%>" >修改</a> <img src="../images/del.jpg" width="11" height="11" align="middle" /> <a href="#" onclick="if(confirm('确认删除该记录？')){location.href='testpjmanage_act.jsp?<%=Constants.ACTION_TYPE%>=<%=Constants.DELETE_STR%>&strProjectId=<%=obj1.getStrProjectId()%>';}" >删除</a></td>  </tr>
             <%
            }
            %>
</table>

<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10%" height="50" valign="bottom"><img src="../images/pldel.jpg" width="83" height="27" align="middle" onclick="del();"/></td>
    <td width="61%" height="50" valign="bottom"><!--<img src="../images/pldel.jpg" width="83" height="27" align="middle" />--> &nbsp;&nbsp;页面记录数
      <select name="strPageSize" id="strPageSize" style="width:52px;" onchange="showAc()">
		<% 
		 String sltOpt[] = {"10","20","30","50","70","100","所有"};
		 for(int i=0; i < sltOpt.length;i++){
		 	String selected = "";
		    if(sltOpt[i].equals(strPageSize))
		      selected="selected='selected'";
		 %>
		 <option value="<%=sltOpt[i] %>" <%=selected %>><%=sltOpt[i] %></option>
   		<%
   		 }
   		 %>
   		 </select>
      <img src="../images/dc.jpg" width="92" height="27" align="middle" onclick="export_sbm('currentPage')" style="cursor:hand"/> 
      <img src="../images/dcall.jpg" width="82" height="27" align="middle" onclick="export_sbm('allPage')" style="cursor:hand"/></td>
      
      <td>  <input id="exportFlag" name="exportFlag" type="hidden" value="exportResult"/>
       		 <input id="strCurPage" name="strCurPage" type="hidden" value=""/>
			<input id="exportContent" name="exportContent" type="hidden" value=""/></td>
    
      <td width="39%" align="right" valign="bottom"><!--<table width="310" border="0" cellspacing="0" cellpadding="0">
       <tr>
        <td width="40"><img src="../images/up.jpg" width="40" height="30" /></td>
        <td width="221" align="center" background="../images/page_bg.jpg" class="page"><a href="#">1</a>&nbsp; <a href="#">2</a>&nbsp; <a href="#">3</a>&nbsp; <a href="#"><span class="sel">4</span></a>&nbsp; <a href="#">5</a> &nbsp;<a href="#">6</a> &nbsp;<a href="#">7</a>&nbsp; <a href="#">8 </a>&nbsp;<a href="#">9</a>&nbsp;...&nbsp;<a href="#">13</a> </td>
        <td width="39"><img src="../images/down.jpg" width="39" height="30" /></td>
       </tr>
    </table>
  -->
  <!-- 翻页开始 -->  
     	<%@ include file="../include/jsp/cpage.jsp"%>
       	<!-- 翻页结束 --> </td>
  </tr>
</table>




 </form>
</body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>